﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="AppSettings"
    targetNamespace="http://cz.osu.engin/AppSettings.xsd"
    elementFormDefault="qualified"
    xmlns="http://cz.osu.engin/AppSettings.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
  <xs:element name="ESettings" type="eSettingsType" />

  <xs:complexType name="eSettingsType">
    <xs:sequence>
      <xs:element name="user" type="userType" minOccurs="1" />
      <xs:element name="runtime" type="runtimeType" minOccurs="1" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="userType">
    <xs:sequence>
      <xs:element name="lastFileName" type="xs:string" minOccurs="1" maxOccurs="1" />
      <xs:element name="map" type="mapType" minOccurs="1" maxOccurs="1" />
      <xs:element name="list" type="listType" minOccurs="1" maxOccurs="1" />
      <xs:element name="noImageImage" type="xs:string" minOccurs="1" maxOccurs="1" />
      <xs:element name="xmlEmbeddedImageSize" type="xmlEmbeddedImageSizeType" minOccurs="1" maxOccurs="1" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="xmlEmbeddedImageSizeType">
    <xs:attribute name="targetWidth">
      <xs:simpleType>
        <xs:restriction base="xs:int">
          <xs:minInclusive value="16" />
          <xs:maxInclusive value="1024" />
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>

  <xs:complexType name="listType">
    <xs:attribute name="emptyTypeString" type="xs:string" use="required" />
  </xs:complexType>

  <xs:complexType name="markerType">
    <xs:attribute name="imageUrl" type="xs:string" use="required" />
    <xs:attribute name="offsetX" type="xs:int" use="required" />
    <xs:attribute name="offsetY" type="xs:int" use="required" />
  </xs:complexType>

  <xs:complexType name="mapType">
    <xs:sequence>
      <xs:element name="marker" type="markerType" minOccurs="1" maxOccurs="1" />
      <xs:element name="selectedMarker" type="markerType" minOccurs="1" maxOccurs="1" />
    </xs:sequence>
    <xs:attribute name="initialLatitude" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:double">
          <xs:minInclusive value="-90" />
          <xs:maxInclusive value="90" />
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="initialLongitude" use="required" >
      <xs:simpleType>
        <xs:restriction base="xs:double">
          <xs:minInclusive value="-180" />
          <xs:maxInclusive value="180" />
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="minZoom" type="xs:int" use="required" />
    <xs:attribute name="maxZoom" type="xs:int" use="required" />
    <xs:attribute name="initialZoom" type="xs:int" use="required" />
    <xs:attribute name="centerSelectedMarker" type="xs:boolean" default="0" />
  </xs:complexType>

  <xs:complexType name="runtimeType">
    <xs:sequence>
      <xs:element name="parsers" type="parsersType" minOccurs="1" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="parsersType">
    <xs:sequence>
      <xs:element name="parser" type="parserType" minOccurs="1" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="parserType">
    <xs:attribute name="title" type="xs:string" use="required" />
    <xs:attribute name="regex" type="xs:string" use="required" />
    <xs:attribute name="isSouthFlagGroupIndex" type="xs:int" use="optional" />
    <xs:attribute name="isWestFlagGroupIndex" type="xs:int" use="optional" />
    <xs:attribute name="latitudeDegreesGroupIndex" type="xs:int" use="required" />
    <xs:attribute name="longitudeDegreesGroupIndex" type="xs:int" use="required" />
    <xs:attribute name="latitudeMinutesGroupIndex" type="xs:int" use="optional" />
    <xs:attribute name="longitudeMinutesGroupIndex" type="xs:int" use="optional" />
    <xs:attribute name="latitudeSecondsGroupIndex" type="xs:int" use="optional" />
    <xs:attribute name="longitudeSecondsGroupIndex" type="xs:int" use="optional" />
    <xs:attribute name="isDefaultTextParser" type="xs:boolean" use="optional" />
    <xs:attribute name="isDefaultClipboardParser" type="xs:boolean" use="optional" />
  </xs:complexType>
</xs:schema>
